﻿Imports System.Data.OleDb
Public Class Rate
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_rate_Click(sender As Object, e As EventArgs) Handles btn_rate.Click
        Dim conn As New OleDbConnection(ConfigurationManager.ConnectionStrings("HauntedLocationString").ConnectionString)
        Dim sql = "INSERT INTO LocationsRating (Rating, Location_fkid, Rater) VALUES (@f1, @f2, @f3)"
        Dim addCmd As New OleDbCommand(sql, conn)
        conn.Open()
        addCmd.Parameters.AddWithValue("@f1", Rating1.CurrentRating)
        addCmd.Parameters.AddWithValue("@f2", Request.Params("ID"))
        addCmd.Parameters.AddWithValue("@f3", User.Identity.Name)
        addCmd.ExecuteNonQuery()
        conn.Close()
        Response.Redirect("MoreDetails.aspx/?ID=" & Request.Params("ID"))
    End Sub


End Class